package com.jsh.erp.web.vo;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zipeng
 * @date 2017/12/12
 */
public class PageVO<T> extends com.baomidou.mybatisplus.extension.plugins.pagination.Page<T> {

    @JsonIgnore
    private Map<Object, Object> condition = new HashMap<>();

    @Override
    public Map<Object, Object> condition() {
        return condition;
    }

    public void setCondition(Map<Object, Object> condition) {
        this.condition = condition;
    }

    @JsonProperty("currentPage")
    @Override
    public Page<T> setCurrent(long current) {
        return super.setCurrent(current);
    }

    @JsonProperty("currentPage")
    @Override
    public long getCurrent() {
        return super.getCurrent();
    }

    @JsonProperty("pageSize")
    @Override
    public long getSize() {
        return super.getSize();
    }

    @JsonProperty("pageSize")
    @Override
    public Page<T> setSize(long size) {
        return super.setSize(size);
    }

    @JsonProperty("rows")
    @Override
    public List<T> getRecords() {
        return super.getRecords();
    }
}
